# langchain prompt工程

from langchain.prompts import PromptTemplate
from langchain.prompts.chat import (
    ChatPromptTemplate,
    SystemMessagePromptTemplate,
    AIMessagePromptTemplate,
    HumanMessagePromptTemplate,
)

#  prompt工程
prompt_template = PromptTemplate.from_template("Tell me a joke about {topic}")

response = prompt_template.invoke({"topic": "cats"})
print(response)


#  chat prompt工程
prompt_template = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant"),
    ("user", "Tell me a joke about {topic}")
])

response =  prompt_template.invoke({"topic": "dogs"})
print(response)

